<?php
namespace app\admin\model;
use think\Model;
use think\Db;

class Index extends Model
{
	public function select()
	{
		$data = Db::name("user")->paginate(5);
		if(empty($data)){
			return false;
		}else{
			return $data;
		}
	}
	
	public function deleteUser()
	{
		$data = \input("get.");
		$res = Db::name("user")->where("id",$data["id"])->delete();
		if($res){
			return true;
		}else{
			return false;
		}
	}
	
	public function getUser()
	{
		$id= \input("get.");
		$data = Db::name("user")->where("id",$id["id"])->find();
		if(empty($data)){
			return false;
		}else{
			return $data;
		}
	}
	
	public function updata()
	{
		$data = \input("post.");
		$res = Db::name("user")->where("id",$data["id"])->update($data);
		if($res){
			return true;
		}else{
			return false;
		}
	}
}
?>